package com.genexususa.eo.bing.data.results;

import com.genexususa.eo.bing.CampaignManagementServiceClasses.BatchError;
import com.genexususa.eo.bing.CampaignManagementServiceClasses.EditorialError;
import com.genexususa.eo.bing.data.GxItemException;

import javax.xml.bind.annotation.*;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "Bing_AdExtensionIdCampaignIdResults")
public class GxAdExtensionIdCampaignIdResults extends GxGeneralResults {
    @XmlElementWrapper(name = "AdExtensionIdCampaignIdResultCollection")
    @XmlElement(name = "AdExtensionIdCampaignIdResult")
    public GxAdExtensionIdCampaignIdResult[] adExtensionIdCampaignIdResultCollection;

    public GxAdExtensionIdCampaignIdResults() {
        super();
    }

    public GxAdExtensionIdCampaignIdResults(String trackingId) {
        super(trackingId);
    }

    public GxAdExtensionIdCampaignIdResults(String trackingId, int resultQuantity) {
        super(trackingId);
        this.adExtensionIdCampaignIdResultCollection = new GxAdExtensionIdCampaignIdResult[resultQuantity];
    }

    public void addResult(int index, GxAdExtensionIdCampaignIdResult adExtensionIdCampaignIdResult) {
        this.adExtensionIdCampaignIdResultCollection[index] = adExtensionIdCampaignIdResult;
    }

    public void addGxExceptionError(GxItemException error, int index) {
        this.adExtensionIdCampaignIdResultCollection[index].addGxExceptionError(error, index);
    }

    public void addBatchError(BatchError error) {
        this.adExtensionIdCampaignIdResultCollection[error.getIndex()].addBatchError(error);
    }

    public void addEditorialError(EditorialError error) {
        this.adExtensionIdCampaignIdResultCollection[error.getIndex()].addEditorialError(error);
    }
}
